package edu.gmu.atelier;


/**
 * Creates QRFactors for given Matrix a.  Assists in numerical iterations
 * where we need to create QRFactors over and over again but want
 * to use different QRFactor implementations.
 * 
 * @author James H. Pope
 */
public interface QRFactorFactory
{
    public static final QRFactorFactory GRAM_SCHMIDT = new QRFactorFactory()
    {
        public QRFactor makeQRFactor(Matrix a)
        {
            return new QRGramSchmidtFactor(a);
        }
    };
    
    public static final QRFactorFactory HOUSEHOLDER = new QRFactorFactory()
    {
        public QRFactor makeQRFactor(Matrix a)
        {
            return new QRHouseholderFactor(a);
        }
    };
    
    
    /**
     * Creates and performs QRFactor on the given Matrix a.
     * @param A
     * @return QR such that A = QR
     */
    public QRFactor makeQRFactor(Matrix a);
}
